package com.luo.demo;

/**
 * @author: luosiyu
 * @Description:
 * @Version: 1.0
 */

public class Rect extends shape {

    public Rect() {
    }

    public Rect(double a, double b) {
        super(a, b);
    }

    @Override
    public double area(){
        return getA()*getB();
    }

    @Override
    public double length(){
        return 2*(getA()+getB());
    }
    @Override
    public String toString() {
        return "矩形的面积="+area()+";周长="+length();
    }
}
